`ifndef _ral_reg_REG_PRJ_sys_cfg_base_config_rtl_
`define _ral_reg_REG_PRJ_sys_cfg_base_config_rtl_

`include "vmm_ral_rw_field_rtl.sv"
`include "vmm_ral_notifier_rtl.sv"


module ral_reg_REG_PRJ_sys_cfg_base_config_rtl(input  clk,
                               input  rstn,
                               input  [31:0] hst_wdat,
                               output [31:0] hst_rdat,
                               input  [3:0] hst_sel,
                               input  hst_wen,
                               output [1:0] mode_out,
                               output mode_rd, mode_wr,
                               input  mode_wen,
                               input  [1:0] mode_in,
                               output [19:0] kernel_size_out,
                               output kernel_size_rd, kernel_size_wr,
                               input  kernel_size_wen,
                               input  [19:0] kernel_size_in,
                               output [2:0] stride_out,
                               output stride_rd, stride_wr,
                               input  stride_wen,
                               input  [2:0] stride_in);

vmm_ral_rw_field_rtl #(2, 'h0)
   mode(clk, rstn, mode_out,
   hst_wdat[1:0], hst_sel[0], hst_wen,
   mode_in, mode_wen);

vmm_ral_rw_field_rtl #(6, ('hab>>0))
   kernel_size_5_0(clk, rstn, kernel_size_out[5:0],
   hst_wdat[7:2], hst_sel[0], hst_wen,
   kernel_size_in[5:0], kernel_size_wen);

vmm_ral_rw_field_rtl #(8, ('hab>>6))
   kernel_size_13_6(clk, rstn, kernel_size_out[13:6],
   hst_wdat[15:8], hst_sel[1], hst_wen,
   kernel_size_in[13:6], kernel_size_wen);

vmm_ral_rw_field_rtl #(6, ('hab>>14))
   kernel_size_19_14(clk, rstn, kernel_size_out[19:14],
   hst_wdat[21:16], hst_sel[2], hst_wen,
   kernel_size_in[19:14], kernel_size_wen);

vmm_ral_rw_field_rtl #(2, ('h1>>0))
   stride_1_0(clk, rstn, stride_out[1:0],
   hst_wdat[23:22], hst_sel[2], hst_wen,
   stride_in[1:0], stride_wen);

vmm_ral_rw_field_rtl #(1, ('h1>>2))
   stride_2_2(clk, rstn, stride_out[2:2],
   hst_wdat[24:24], hst_sel[3], hst_wen,
   stride_in[2:2], stride_wen);


vmm_ral_notifier_rtl _n_mode(clk, rstn, hst_sel[0], hst_wen, mode_rd, mode_wr);
vmm_ral_notifier_rtl _n_kernel_size(clk, rstn, |hst_sel[2:0], hst_wen, kernel_size_rd, kernel_size_wr);
vmm_ral_notifier_rtl _n_stride(clk, rstn, |hst_sel[3:2], hst_wen, stride_rd, stride_wr);


assign hst_rdat[31:0] = { stride_out, kernel_size_out, mode_out };


endmodule

`endif
